Fix building with recent QT5 versions.
authorBernd Zeimetz <bernd@bzed.de>
Mon, 28 Aug 2017 21:10:54 +0000 (23:10 +0200)
committerBernd Zeimetz <bernd@bzed.de>
Mon, 28 Aug 2017 21:51:00 +0000 (23:51 +0200)
debian/patches/fix-qt5-build [new file with mode: 0644]
debian/patches/series

diff --git a/debian/patches/fix-qt5-build b/debian/patches/fix-qt5-build
new file mode 100644 (file)
index 0000000..798a1e7
--- /dev/null
@@ -0,0 +1,144 @@
+--- a/gpx.cc
++++ b/gpx.cc
+@@ -494,7 +494,7 @@ tag_cache_desc(const QXmlStreamAttribute
+ {
+   cache_descr_is_html = 0;
+   if (attr.hasAttribute("html")) {
+-    if (attr.value("html").toString().compare("True") == 0) {
++    if (attr.value("html").toString().compare(QString("True")) == 0) {
+       cache_descr_is_html = 1;
+     }
+   }
+@@ -509,16 +509,16 @@ tag_gs_cache(const QXmlStreamAttributes&
+     gc_data->id = attr.value("id").toString().toInt();
+   }
+   if (attr.hasAttribute("available")) {
+-    if (attr.value("available").toString().compare("True", Qt::CaseInsensitive) == 0) {
++    if (attr.value("available").toString().compare(QString("True"), Qt::CaseInsensitive) == 0) {
+       gc_data->is_available = status_true;
+-    } else if (attr.value("available").toString().compare("False", Qt::CaseInsensitive) == 0) {
++    } else if (attr.value("available").toString().compare(QString("False"), Qt::CaseInsensitive) == 0) {
+       gc_data->is_available = status_false;
+     }
+   }
+   if (attr.hasAttribute("archived")) {
+-    if (attr.value("archived").toString().compare("True", Qt::CaseInsensitive) == 0) {
++    if (attr.value("archived").toString().compare(QString("True"), Qt::CaseInsensitive) == 0) {
+       gc_data->is_archived = status_true;
+-    } else if (attr.value("archived").toString().compare("False", Qt::CaseInsensitive) == 0) {
++    } else if (attr.value("archived").toString().compare(QString("False"), Qt::CaseInsensitive) == 0) {
+       gc_data->is_archived = status_false;
+     }
+   }
+@@ -972,7 +972,7 @@ gpx_end(const QString& el)
+      * last date we saw in this log.
+      */
+   case tt_cache_log_type:
+-    if ((cdatastr.compare("Found it") == 0) &&
++    if ((cdatastr.compare(QString("Found it")) == 0) &&
+         (0 == wpt_tmp->gc_data->last_found.toTime_t())) {
+       wpt_tmp->AllocGCData()->last_found = gc_log_date;
+     }
+@@ -1423,7 +1423,7 @@ fprint_xml_chain(xml_tag* tag, const Way
+         fprint_xml_chain(tag->child, wpt);
+       }
+       if (wpt && wpt->gc_data->exported.isValid() &&
+-          tag->tagname.compare("groundspeak:cache") == 0) {
++          tag->tagname.compare(QString("groundspeak:cache")) == 0) {
+         writer->writeTextElement("time",
+                                  wpt->gc_data->exported.toPrettyString());
+       }
+--- a/tef_xml.cc
++++ b/tef_xml.cc
+@@ -72,11 +72,11 @@ tef_start(xg_string args, const QXmlStre
+   bool valid = false;
+   foreach(QXmlStreamAttribute attr, *attrv) {
+-    if (attr.name().compare("Comment", Qt::CaseInsensitive) == 0) {
+-      if (attr.value().compare("TourExchangeFormat", Qt::CaseInsensitive) == 0) {
++    if (attr.name().compare(QString("Comment"), Qt::CaseInsensitive) == 0) {
++      if (attr.value().compare(QString("TourExchangeFormat"), Qt::CaseInsensitive) == 0) {
+         valid = true;
+       }
+-    } else if (attr.name().compare("Version", Qt::CaseInsensitive) == 0) {
++    } else if (attr.name().compare(QString("Version"), Qt::CaseInsensitive) == 0) {
+       version = attr.value().toString().toDouble();
+     }
+   }
+@@ -95,9 +95,9 @@ tef_header(xg_string args, const QXmlStr
+ {
+   route = route_head_alloc();
+   foreach(QXmlStreamAttribute attr, *attrv) {
+-    if (attr.name().compare("Name", Qt::CaseInsensitive) == 0) {
++    if (attr.name().compare(QString("Name"), Qt::CaseInsensitive) == 0) {
+       route->rte_name = attr.value().toString().trimmed();
+-    } else if (attr.name().compare("Software", Qt::CaseInsensitive) == 0) {
++    } else if (attr.name().compare(QString("Software"), Qt::CaseInsensitive) == 0) {
+       route->rte_desc = attr.value().toString().trimmed();
+     }
+   }
+@@ -248,20 +248,20 @@ tef_item_start(xg_string args, const QXm
+     QString attrstr = attr.value().toString();
+     QByteArray attrtext = attrstr.toUtf8();
+-    if (attr.name().compare("SegDescription", Qt::CaseInsensitive) == 0) {
++    if (attr.name().compare(QString("SegDescription"), Qt::CaseInsensitive) == 0) {
+       wpt_tmp->shortname = attrstr.trimmed();
+-    } else if (attr.name().compare("PointDescription", Qt::CaseInsensitive) == 0) {
++    } else if (attr.name().compare(QString("PointDescription"), Qt::CaseInsensitive) == 0) {
+       wpt_tmp->description = attrstr.trimmed();
+-    } else if (attr.name().compare("ViaStation", Qt::CaseInsensitive) == 0 &&
+-               attr.value().compare("true", Qt::CaseInsensitive) == 0) {
++    } else if (attr.name().compare(QString("ViaStation"), Qt::CaseInsensitive) == 0 &&
++               attr.value().compare(QString("true"), Qt::CaseInsensitive) == 0) {
+       wpt_tmp->wpt_flags.fmt_use = 1;  /* only a flag */
+       /* new in TEF V2 */
+-    } else if (attr.name().compare("Instruction", Qt::CaseInsensitive) == 0) {
++    } else if (attr.name().compare(QString("Instruction"), Qt::CaseInsensitive) == 0) {
+       wpt_tmp->description = attrstr.trimmed();
+-    } else if (attr.name().compare("Altitude", Qt::CaseInsensitive) == 0) {
++    } else if (attr.name().compare(QString("Altitude"), Qt::CaseInsensitive) == 0) {
+       wpt_tmp->altitude = attrstr.toDouble();
+-    } else if (attr.name().compare("TimeStamp", Qt::CaseInsensitive) == 0) {
++    } else if (attr.name().compare(QString("TimeStamp"), Qt::CaseInsensitive) == 0) {
+       /* nothing for the moment */
+     }
+   }
+--- a/magproto.cc
++++ b/magproto.cc
+@@ -819,11 +819,11 @@ mag_rd_init_common(const QString& portna
+    */
+   QString exten = QFileInfo(curfname).suffix();
+   if (exten.length() > 0) {
+-    if (0 == exten.compare("upt", Qt::CaseInsensitive)) {
++    if (0 == exten.compare(QString("upt"), Qt::CaseInsensitive)) {
+       extension_hint = WPTDATAMASK;
+-    } else if (0 == exten.compare("log", Qt::CaseInsensitive)) {
++    } else if (0 == exten.compare(QString("log"), Qt::CaseInsensitive)) {
+       extension_hint = TRKDATAMASK;
+-    } else if (0 == exten.compare("rte", Qt::CaseInsensitive)) {
++    } else if (0 == exten.compare(QString("rte"), Qt::CaseInsensitive)) {
+       extension_hint = RTEDATAMASK;
+     }
+   }
+--- a/unicsv.cc
++++ b/unicsv.cc
+@@ -430,13 +430,13 @@ unicsv_parse_time(const QString& str, in
+ static status_type
+ unicsv_parse_status(const QString& str)
+ {
+-  if (str.compare("true", Qt::CaseInsensitive) == 0 ||
+-      str.compare("yes", Qt::CaseInsensitive) == 0 ||
++  if (str.compare(QString("true"), Qt::CaseInsensitive) == 0 ||
++      str.compare(QString("yes"), Qt::CaseInsensitive) == 0 ||
+       str == "1") {
+     return status_true;
+   }
+-  if (str.compare("false", Qt::CaseInsensitive) == 0 ||
+-      str.compare("no", Qt::CaseInsensitive) == 0 ||
++  if (str.compare(QString("false"), Qt::CaseInsensitive) == 0 ||
++      str.compare(QString("no"), Qt::CaseInsensitive) == 0 ||
+       str == "0") {
+     return status_false;
+   }
index 4c729dc7e75e503ea0d4b79ba1f2658c0bdf12ee..89d4024e5909e7548f76329a4395c766b15cbf68 100644 (file)
@@ -4,3 +4,4 @@ gpsbabelfe_do-not-check-for-newer-version
 htmldoc-location
 gpsbabelfe-name
 use_minizip
+fix-qt5-build